library date_picker;

import 'package:get/get.dart';

import 'view.dart';

export './state.dart';
export './controller.dart';
export './view.dart';

enum DatePickerType {
  y,
  ym,
  ymd,
  ymdhm,
  ymdapm,
  meeting,
  quarter,
}

typedef DatePickerResult = Function(DateTime? date, bool isAm);
Future<void> showDateDayPicker({
  DatePickerType type = DatePickerType.ymdapm,
  DateTime? minDate,
  DateTime? maxDate,
  DateTime? current,
  required DatePickerResult result,
  bool isLoop = false,
}) async {
  await Get.to(
    () => DatePickerPage(
      type: type,
      minDate: minDate,
      maxDate: maxDate,
      result: result,
      current: current,
      isLoop: isLoop,
    ),
    opaque: false,
    transition: Transition.downToUp,
    fullscreenDialog: true,
    duration: const Duration(milliseconds: 200),
  );
}
